#include <bits/stdc++.h>

using namespace std;

#define in read()

typedef long long ll;

const int MAXN = 8e5+10;
const int mod = 998244353;
const int g = 3;

int read(){int x=0,sgn=1;char ch = getchar();for(;!isdigit(ch);ch=getchar())if(ch=='-')sgn=-1;for(;isdigit(ch);ch=getchar())x=(x<<1)+(x<<3)+(ch^48);return x*sgn;}

int qp(ll x,int t){ll res=1;for(;t;t>>=1,x=x*x%mod)if(t&1)res=res*x%mod;return res;}

int rev[MAXN],n;
ll F[MAXN],G[MAXN];

void change(ll *f,int len){
	for(int i = 1;i < len;i++) rev[i] = (rev[i>>1]>>1) | (i & 1 ? len >> 1 : 0);
	for(int i = 1;i < len;i++) if(i < rev[i]) swap(f[i],f[rev[i]]);
}

void NTT(ll *f,int len,int on){
	change(f,len);
	for(int h = 2;h<=len;h<<=1){
		ll gn = qp(g,(mod-1)/h);
		for(int i = 0;i < len;i+=h){
			ll gg = 1;
			for(int k = i;k < i + h / 2;k++){
				ll u = f[k],v = f[k + h/2] * gg % mod; gg = gg * gn % mod;
				f[k] = (u + v) % mod,f[k + h/2] = (u - v + mod) % mod;
			}
		}
	}
	if(on==-1){reverse(f+1,f+len);ll inv = qp(len,mod-2);for(int i = 0;i < len;i++) f[i] = f[i] * inv % mod;}
}

void getinv(ll *f,int len,ll * g){
	ll invv[MAXN]; fill(g,g+len+len,0);
	g[0] = qp(f[0],mod-2);
	for(int h = 2;h <= len;h<<=1){
		int h2 = h<<1; copy(f,f+h,invv);fill(invv+h,invv+h2,0);NTT(invv,h2,1);NTT(g,h2,1);
		for(int i = 0;i < h2;i++) g[i] = g[i] * ((2-invv[i]*g[i]%mod + mod) % mod) % mod;
		NTT(g,h2,-1);fill(g+h,g+h2,0);
	}
}

int main (){
	n = in;for(int i = 0;i < n;i++) F[i] = in;int len = 1;for(;len<n;len<<=1);
	getinv(F,len,G);for(int i = 0;i < n;i++) printf("%lld%c",G[i]," \n"[i==n-1]);return 0;
}
